<include file="Public:header" />
<style type="text/css">
.upload_c{ width:187px; height:124px; border:1px solid #c6c6c6; background:#fafafa; margin:0 auto; text-align:center;}
.upload_c select{ width:162px; height:23px; line-height:23px; margin:23px 0 18px 0;}
.upload_btn{ background:../Public/personal/images/upload_bt.jpg no-repeat; width:157px; height:42px; border:none;}
</style>
<link href="../Public/personal/css/person.css" rel="stylesheet" type="text/css" />
<script language='JavaScript'>
  function addfr(val){
	 //if(val == '' || !confirm('确定加为好友？')) return false;
	 $.post("{:U('Personal/addfr')}",{fuid:val},function(res){
		 //if (res==2) $('#sp').html(<input type="button"  value="-解除好友" class="removef_btn"/>);
		 if (res==1) {
			 alert('添加成功！');
			 $("#sp_"+val).html("<input type='button'  value='-解除好友' class='removef_btn' onclick='delefr("+val+")'/>");
			 }
		 if (res==0) alert('添加失败！');
		 if (res==2) alert('您已添加他为好友！');
	 });
   }
  function delefr(val){
	  if(val == '' || !confirm('确定解除好友？')) return false; 
	  $.post("{:U('Personal/delefr')}",{fuid:val},function(res){
		  if(res==1) {
			  alert('解除成功！');
			  $("#sp_"+val).html("<input type='button'  value='+加为好友' class='addf_btn' onclick='addfr("+val+")'/>");
			  }
		  if(res==0) alert('解除失败');
	  })
  }
     function sendmsg(val){
		 var Left=($(window).width()-$('#tid').width())/2;
		 var Top=($(window).height()-$('#tid').height())/2;　
		 $('#title').val("");
		 $('#content').val("");
	  $('#tid').fadeIn().css({'top': Top, 'left': Left });
	  $('#tid form span').html("<input type='hidden' name='puid' id='puid' value='"+val+"'/>");
	  $('body').append("<div id='fade'></div>");
	  $("#fade").css({ "filter": "alpha(opacity=0)" }).fadeIn();
      
     }
   //  $(document).ready(function(){
    	function quxiao()
		{
			$(".tid").fadeOut(function(){
				$("#fade").remove();
				//window.location.href="{:U('Picture/upload')}";
			});
		}
		   
    	function fasong()
    	{
    		var fuid=$('#puid').val(); var title=$('#title').val();var content=$('#content').val();
        	$.post("{:U('Personal/send')}",{fuid:fuid,title:title,content:content},function(res){
        		$("#tid").hide();
        	    $("#fade").remove();
        		if(res==1)  alert('发送成功');
        		if(res==0)  alert('发送失败');
        		if(res==2)  alert('标题或内容不能为空');
        	});
		   }

		 

//})
</script>
<div class="content">
<div class="crumbs">当前位置：<a href="#">个人空间</a></div>
<div class="w_content">
<div class="c_l">
<div class="c_lt">
<div class="per_info">
<eq name='basic.image' value=''><img src="__PUBLIC__/Uploads/PersonImage/per_img.jpg" />
<else/><img src="__PUBLIC__/Uploads/PersonImage/s_{$basic['image']}"/>
</eq>
<div class="pinfo">
<p class="pname">{$basic['nickname']}</p>
<p class="plevel">等 级：{$basic['lname']}</p>
<p class="pintegral">积 分：{$basic['score']}分</p>
<a href="{:U('user/logout')}" ><input type="button" onclick="window.location.href='{:U('user/logout')}'" value="退出系统" style="cursor:pointer;" class="exit_btn"/></a>
</div>
<div class="clear"></div>
</div>
<ul>
<li class="resources"><a href="{:U('Personal/mysource')}">我的资源</a></li>
<li class="favorite"><a href="{:U('Personal/favorite')}">我的收藏夹</a></li>
<li class="edit"><a href="{:U('Personal/basicinfo')}">编辑资料</a></li>
<li class="friend"><a href="{:U('Personal/friend')}">我的好友</a></li>
<li class="message"><a href="{:U('Personal/message')}">短消息({$urcount}未读)</a></li>
</ul>
</div>
<div class="c_lb">
<div class="upload_c">
<select id="cate">
<option value="1">图片</option>
<option value="2">视频</option>
<option value="3">动画</option>
<option value="4">游戏</option>
<option value="5">文章</option>
<option value="6">挂图</option>
<option value="7">图书</option>
<option value="8">展品</option>
<option value="9">知识题</option>
</select>
<img src="../Public/personal/images/upload_bt.jpg" style="cursor:pointer;" onclick="upload();" />
</div>
</div>
</div>
<div class="c_m">
<div class="c_mtab">
<h3>个人动态</h3>
<ul>
<foreach name='cates' item='vo'> 
<if condition="$vo['cate'] eq 'Picture'">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmpic.jpg" /></span><p><span class="category"><a href="{:U('Picture/index')}">[图片]</a></span><span class="details"><a href="{:U('Picture/info',array('vid'=>$vo['pid']))}" target="blank"> {$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
<if condition="$vo['cate'] eq 'Video' ">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmvideo.jpg" /></span><p><span class="category"><a href="{:U('Video/index')}">[视频]</a></span><span class="details"><a href="{:U('Video/info',array('vid'=>$vo['vid']))}" target="blank">{$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
<if condition="$vo['cate'] eq 'Article' ">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmpage.jpg" /></span><p><span class="category"><a href="{:U('Article/index')}">[文章]</a></span><span class="details"><a href="{:U('Article/info',array('vid'=>$vo['aid']))}" target="blank">{$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
<if condition="$vo['cate'] eq 'Flash' ">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmflash.jpg" /></span><p><span class="category"><a href="{:U('Flash/index')}">[动画]</a></span><span class="details"><a href="{:U('Flash/info',array('vid'=>$vo['flaid']))}" target="blank">{$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
<if condition="$vo['cate'] eq 'Game' ">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmgame.jpg" /></span><p><span class="category"><a href="{:U('Game/index')}">[游戏]</a></span><span class="details"><a href="{:U('Game/info',array('vid'=>$vo['gid']))}" target="blank">{$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
<if condition="$vo['cate'] eq 'Image' ">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmimg.jpg" /></span><p><span class="category"><a href="{:U('Image/index')}">[挂图]</a></span><span class="details"><a href="{:U('Image/info',array('vid'=>$vo['iid']))}" target="blank">{$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
<if condition="$vo['cate'] eq 'Book' ">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmbook.jpg" /></span><p><span class="category"><a href="{:U('Book/index')}">[图书]</a></span><span class="details"><a href="{:U('Book/info',array('vid'=>$vo['bid']))}" target="blank">{$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
<if condition="$vo['cate'] eq 'Exhibits' ">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmexhibits.jpg" /></span><p><span class="category"><a href="{:U('Exhibits/index')}">[展品]</a></span><span class="details"><a href="{:U('Exhibits/info',array('vid'=>$vo['eid']))}" target="blank">{$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
<if condition="$vo['cate'] eq 'Knowledge' ">
<li><span class="cmlistimg"><img src="../Public/personal/images/cmknowledge.jpg" /></span><p><span class="category"><a href="{:U('Knowledge/index')}">[知识]</a></span><span class="details"><a href="{:U('Knowledge/info',array('vid'=>$vo['kid']))}" target="blank">{$vo['title']}</a></span><span class="time">{$vo.uploadtime|date="Y-m-d",###}</span></p></li>
</if>
</foreach>
</ul>
<div class="clear"></div>
</div>
<div class="c_mbab">
<h3>好友动态</h3>
<ul>
<foreach name='listdoc' item='vo'>
<li class="friend_list">
<dl>
<eq name='vo.image' value=''><dt><a href ="{:U('Personal/hiszoon',array('id'=>$vo['huid']))}" style="cursor: pointer;"><img src="../Public/personal/images/f_head.jpg" /></a></dt>
<else/><dt><a href ="{:U('Personal/hiszoon',array('id'=>$vo['huid']))}" style="cursor: pointer;"><img src="__PUBLIC__/Uploads/PersonImage/s_{$vo['image']}" width='75px' height='75px'/></a></dt>
</eq>
<dd>
<p><a href ="{:U('Personal/hiszoon',array('id'=>$vo['huid']))}" style="cursor: pointer;color: #216AB2;font-weight: bold;">{$vo.nickname}</a></p>
<ul class="details_list">
<?php foreach($vo['arr'] as $val){ ?>
  <li><span class="category">上传{$val.china}</span><span class="details">
  <if condition="$val['type'] eq 'Picture'"> 
  <a href="{:U('Picture/info',array('vid'=>$val['pid']))}" target="blank">
  </if>
  <if condition="$val['type'] eq 'Video'">
  <a href="{:U('Video/info',array('vid'=>$val['vid']))}" target="blank">
  </if>
  <if condition="$val['type'] eq 'Flash'">
  <a href="{:U('Flash/info',array('vid'=>$val['flaid']))}" target="blank">
  </if>
  <if condition="$val['type'] eq 'Game'">
  <a href="{:U('Game/info',array('vid'=>$val['gid']))}" target="blank">
  </if>
  <if condition="$val['type'] eq 'Article'">
  <a href="{:U('Article/info',array('vid'=>$val['aid']))}" target="blank">
  </if>
  <if condition="$val['type'] eq 'Image'">
  <a href="{:U('Image/info',array('vid'=>$val['iid']))}" target="blank">
  </if>
  <if condition="$val['type'] eq 'Book'">
  <a href="{:U('Book/info',array('vid'=>$val['bid']))}" target="blank">
  </if>
  <if condition="$val['type'] eq 'Exhibits'">
  <a href="{:U('Exhibits/info',array('vid'=>$val['eid']))}" target="blank">
  </if>
  <if condition="$val['type'] eq 'Knowledge'">
  <a href="{:U('Knowledge/info',array('vid'=>$val['kid']))}" target="blank">
  </if>
  {$val.title}
  </a>
  </span><span class="time">{$val.uploadtime|date="Y-m-d",###}</span></li></br>
<?php } ?>
</ul>
</dd>
</dl>
</li>
</foreach>

</ul>
<div class="clear"></div>
</div>
</div>
<div class="c_r">
<div class="welcome">
<h3>欢迎新朋友</h3><span class="more"></span>
<div class="clear"></div>
<ul class="welcomef">
<volist name='user' id='vo'>
	 <li>
	<span class="hportrait">
	<if condition="$vo['image'] eq ''"><a href="{:U('Personal/hiszoon',array('id'=>$vo['uid']))}"><img src="../Public/personal/images/f_head.jpg" width='75px' height='75px'/></a>
	<else/><a href="{:U('Personal/hiszoon',array('id'=>$vo['uid']))}"><img src="__PUBLIC__/Uploads/PersonImage/s_{$vo['image']}" width='75px' height='75px'/></a>
	</if>
	</span>
	<span class="username"><a href="{:U('Personal/hiszoon',array('id'=>$vo['uid']))}">{$vo['nickname']|msubstr=###,0,5}</a></span>
	<span class="addf" id="sp_{$vo['uid']}"><input type="button"  value="+加为好友" class="addf_btn" id='addfr' onclick="addfr({$vo['uid']});"/></span>
	<span class="sendf"><input type="button" value="@发送消息" class="sendf_btn" id='sendmes'onclick="sendmsg({$vo['uid']});"/></span>
	</li>
</volist>

</ul>
<div class="clear"></div>
</div>
<div class="wefriend">
<h3>我的好友</h3><span class="more"><a href="{:U('Personal/friend')}">更多</a></span>
<div class="clear"></div>
<ul class="welcomef">
<empty name="listfr">
	<p style="text-align:center; font-size:14px;">暂无好友</p>
<else />
<volist name='listfr' id='vo'  offset="0" length='4'>
<li>
<span class="hportrait">
	<if condition="$vo['image'] eq ''"><a href="{:U('Personal/hiszoon',array('id'=>$vo['fuid']))}"><img src="../Public/personal/images/f_head.jpg" width='75px' height='75px'/></a>
	<else/><a href="{:U('Personal/hiszoon',array('id'=>$vo['fuid']))}"><img src="__PUBLIC__/Uploads/PersonImage/s_{$vo['image']}" width='75px' height='75px'/></a>
	</if>
</span>
<span class="username"><a href="{:U('Personal/hiszoon',array('id'=>$vo['fuid']))}">{$vo['fnickname']|msubstr=###,0,5}</a></span>
<span class="removef" id="sp_{$vo['fuid']}"><input type="button"  value="-解除好友" class="removef_btn" onclick="delefr({$vo['fuid']})"/></span>
<span class="sendf"><input type="button" value="@发送消息" class="sendf_btn" onclick="sendmsg({$vo['fuid']});"/></span>
</li>
</volist>
</empty>
</ul>
<div class="clear"></div>
</div>
<div class="searchuser">
<p>搜索用户</p>
<form action="{:U('Personal/search')}" method="get">
<input class="lesear" type="text" name="keyword" /><input type="submit" value="搜索" />
</form>
</div>
</div>
<div class="clear"></div>
</div>
</div>

 <div id='tid' class='tid'>
  <h3>发送短信息</h3>
  <span>&nbsp;</span>
   <form action="{:U('Personal/message')}" method='post'> 
   <span></span>
   <table align='center'>
      <tr><td width='50px' height='50px'>  标题：</td><td><input type='text' name='title' class='title' id='title'/></td></tr>
      <tr><td  width='50px' valign='top'> 内容：</td><td><textarea name='content' id='content' class='desc'></textarea></td></tr>
       <tr><td colspan='2' align='center'><input type='button' value='发 送' id='send' class='send' onclick="fasong();"/><input type='button' id='cancel' class='cancel' value='取消' onclick="quxiao();"/></td></tr>
     </table>
   </form>
 </div>
<script type="text/javascript">
function upload()
{
	var cate=$("#cate").val();

	switch (parseInt(cate))
	{
		case 1:window.location.href="{:U('Picture/upload')}";break;
		case 2:window.location.href="{:U('Video/upload')}";break;
		case 3:window.location.href="{:U('Flash/upload')}";break;
		case 4:window.location.href="{:U('Game/upload')}";break;
		case 5:window.location.href="{:U('Article/upload')}";break;
		case 6:window.location.href="{:U('Image/upload')}";break;
		case 7:window.location.href="{:U('Book/upload')}";break;
		case 8:window.location.href="{:U('Exhibits/upload')}";break;
		case 9:window.location.href="{:U('Knowledge/upload')}";break;
	}
}
</script>
<include file="Public:footer" />